package com.google.gwt.gfx.client.graphics.svg;

import com.google.gwt.gfx.client.graphics.Line;

public class SVGLine extends Line {

	public SVGLine() {
		super(SVG.createElement("line"));
	}

	@Override
	protected int getFromLeft() {
		return Integer.parseInt(SVG.getElementProperty(getElement(), "x1"));
	}

	@Override
	protected int getFromTop() {
		return Integer.parseInt(SVG.getElementProperty(getElement(), "y1"));
	}

	@Override
	protected int getToLeft() {
		return Integer.parseInt(SVG.getElementProperty(getElement(), "x2"));
	}

	@Override
	protected int getToTop() {
		return Integer.parseInt(SVG.getElementProperty(getElement(), "y2"));
	}

	@Override
	protected void setFromLeft(int left) {
		SVG.setElementProperty(getElement(), "x1", left + "");
	}

	@Override
	protected void setFromTop(int top) {
		SVG.setElementProperty(getElement(), "y1", top + "");
	}

	@Override
	protected void setToLeft(int left) {
		SVG.setElementProperty(getElement(), "x2", left + "");
	}

	@Override
	protected void setToTop(int top) {
		SVG.setElementProperty(getElement(), "y2", top + "");
	}

}
